Scope resource names to CR instance for multi-CR support#115
Conversation
Multiple OpenStackLightspeed CRs in the same namespace failed because all Kubernetes resources used hardcoded names, causing ownership conflicts on the second CR. Convert resource name constants to functions that prefix with the instance name and add app.kubernetes.io/instance to label selectors so each CR manages its own isolated set of resources.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dprince The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hi @dprince. Thanks for your PR. I'm waiting for a openstack-lightspeed member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/ok-to-test |
|
@dprince: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
lpiwowar
left a comment
There was a problem hiding this comment.
Thanks for the PR!:) Just two comments.
| func ConsoleUIDeploymentName(instanceName string) string { | ||
| return instanceName + "-console-plugin" | ||
| } | ||
| func ConsoleUIPluginName(instanceName string) string { |
There was a problem hiding this comment.
issue (blocking): The console plugin does not get deployed currently with this version of the code (even with a single OpenStackLightspeed instance). I think that the console is using the plugin name to fetch files from the console plugin pod and since the ConsoleUIPluginName is dynamic now the console is trying to retrieve a file from the Lightspeed Console Plugin image that does not exist. Hardcoding the return value to lightspeed-console-plugin worked.
| cm := &corev1.ConfigMap{ | ||
| ObjectMeta: metav1.ObjectMeta{ | ||
| Name: CABundleConfigMapName, | ||
| Name: CABundleConfigMapName(instance.Name), |
There was a problem hiding this comment.
question: Do we really want the operator to accept multiple OpenStackLightspeed instances at this point? Just a thread for a discussion. I remember we initially wanted to support only one OpenStackLightspeed instance.
The opposite direction would be to allow only one instance of OpenStackLightspeed at this point (e.g., accept one single instance with a specific name openstack-lightspeed).
Multiple OpenStackLightspeed CRs in the same namespace failed because all Kubernetes resources used hardcoded names, causing ownership conflicts on the second CR. Convert resource name constants to functions that prefix with the instance name and add app.kubernetes.io/instance to label selectors so each CR manages its own isolated set of resources.